import { axios } from '@/utils/request'

const api = {
  // 商家优惠券列表
  getList: '/marketing/business-coupon-list',
  changeStatus: '/marketing/business-coupon-status',
  // 添加会员卡
  addVipCard: '/alliance-member/add-member',
  // 添加会员卡
  editVipCard: '/alliance-member/edit-member',
  // 会员卡权益列表
  rightsList: '/alliance-member/get-right-info',
  // 会员卡列表
  vipCardList: '/alliance-member/list',
  // 改变会员卡状态
  changeVipStatus: '/alliance-member/edit-status',
  // 根据id获取会员卡详情
  getVipCard: '/alliance-member/get-member-info',
  // 删除会员卡
  delVipCard: '/alliance-member/del-member',
  // 商家卡券列表
  verifyList: '/marketing/business-verify-list',
  // 购买会员卡记录
  vipBuyRecord: '/alliance-member/buy-cart-list',
  // 获取分销中心提现设置
  getWithdrawSetting: '/share/get-saas-share-setting',
  // 保存分销中心提现设置
  saveWithdrawSetting: '/share/saas-basic-setting',
  // 提现列表
  withdrawList: '/share/saas-cash',
  // 同意提现
  agreeWithdraw: '/share/saas-apply',
  // 确认提现
  confirmWithdraw: '/share/saas-confirm'
}

export default api

export function getList(parameter) {
  return axios({
    url: api.getList,
    method: 'get',
    params: parameter
  })
}

export function changeStatus(parameter) {
  return axios({
    url: api.changeStatus,
    method: 'post',
    data: parameter
  })
}

export function addVipCard(parameter) {
  return axios({
    url: api.addVipCard,
    method: 'post',
    data: parameter
  })
}

export function editVipCard(parameter) {
  return axios({
    url: api.editVipCard,
    method: 'post',
    data: parameter
  })
}

export function rightsList(parameter) {
  return axios({
    url: api.rightsList,
    method: 'post',
    data: parameter
  })
}

export function vipCardList(parameter) {
  return axios({
    url: api.vipCardList,
    method: 'post',
    data: parameter
  })
}

export function changeVipStatus(parameter) {
  return axios({
    url: api.changeVipStatus,
    method: 'post',
    data: parameter
  })
}

export function getVipCard(parameter) {
  return axios({
    url: api.getVipCard,
    method: 'post',
    data: parameter
  })
}

export function delVipCard(parameter) {
  return axios({
    url: api.delVipCard,
    method: 'post',
    data: parameter
  })
}

export function verifyList(parameter) {
  return axios({
    url: api.verifyList,
    method: 'post',
    data: parameter
  })
}

export function vipBuyRecord(parameter) {
  return axios({
    url: api.vipBuyRecord,
    method: 'post',
    data: parameter
  })
}

export function getWithdrawSetting(parameter) {
  return axios({
    url: api.getWithdrawSetting,
    method: 'get',
    params: parameter
  })
}

export function saveWithdrawSetting(parameter) {
  return axios({
    url: api.saveWithdrawSetting,
    method: 'post',
    data: parameter
  })
}

export function confirmWithdraw(parameter) {
  return axios({
    url: api.confirmWithdraw,
    method: 'post',
    data: parameter
  })
}

export function withdrawList(parameter) {
  return axios({
    url: api.withdrawList,
    method: 'get',
    params: parameter
  })
}

export function agreeWithdraw(parameter) {
  return axios({
    url: api.agreeWithdraw,
    method: 'post',
    data: parameter
  })
}